<?php

namespace app\admin\validate\kefu;

use think\Validate;

class User extends Validate
{
    protected $failException = true;

    /**
     * 验证规则
     */
    protected $rule = [
        'user_id'  => 'unique:kefu_user',
        'admin_id' => 'unique:kefu_user',
    ];

    /**
     * 提示消息
     */
    protected $message = [
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => [],
        'edit' => [],
    ];

    public function __construct()
    {
        $this->field   = [
            'user_id'  => '绑定会员',
            'admin_id' => '绑定管理员',
        ];
        $this->message = array_merge($this->message, [
            'user_id.unique'  => '该会员已经被其他账户绑定过了！',
            'admin_id.unique' => '该管理员已经被其他账户绑定过了',
        ]);
        parent::__construct();
    }
}
